package cn.edu.cuc.yjsy.admin.util;

import cn.edu.cuc.yjsy.model.ModelPackage;
import java.util.HashMap;
import java.util.Map;

public class StudentAttributes {

	private static Map attributes = new HashMap(ModelPackage.STUDENT_FEATURE_COUNT);
	private final static Map columnsName = new HashMap(ModelPackage.STUDENT_FEATURE_COUNT);
	
	static{
		initialColumnName();
		initialAttribute();
	}

	private static void initialAttribute() {
		attributes.put(new Integer(ModelPackage.STUDENT__NUMBER), "xh");
		attributes.put(new Integer(ModelPackage.STUDENT__NAME), "xm");
		attributes.put(new Integer(ModelPackage.STUDENT__COLLEGECODE), "pydwm");
		attributes.put(new Integer(ModelPackage.STUDENT__COLLEGE), "pydw");
		attributes.put(new Integer(ModelPackage.STUDENT__EXAMINENUMBER), "ksh");
		attributes.put(new Integer(ModelPackage.STUDENT__GENDER), "xb");
		attributes.put(new Integer(ModelPackage.STUDENT__NATIONALITY), "mz");
		attributes.put(new Integer(ModelPackage.STUDENT__BIRTHDAY), "csrq");
		attributes.put(new Integer(ModelPackage.STUDENT__GRADE), "dqszj");
		attributes.put(new Integer(ModelPackage.STUDENT__LENGTH), "xz");
		attributes.put(new Integer(ModelPackage.STUDENT__IDNUMBER), "sfzh");
		attributes.put(new Integer(ModelPackage.STUDENT__LEVEL), "pycc");
		attributes.put(new Integer(ModelPackage.STUDENT__REGISTERDATE), "rxrq");
		attributes.put(new Integer(ModelPackage.STUDENT__LEARNTYPE), "xxxs");
		attributes.put(new Integer(ModelPackage.STUDENT__MATRICULANDTYPE), "lqlb");
		attributes.put(new Integer(ModelPackage.STUDENT__RESULT), "bjyjl");
		attributes.put(new Integer(ModelPackage.STUDENT__GRADUATEDATE), "byrq");
		attributes.put(new Integer(ModelPackage.STUDENT__DIPLOMACODE), "zsbh");
		attributes.put(new Integer(ModelPackage.STUDENT__SPECIALITYCODE), "zydm");
		attributes.put(new Integer(ModelPackage.STUDENT__SPECIALITYNAME), "zymc");
		attributes.put(new Integer(ModelPackage.STUDENT__PROVINCE), "syszd");
		attributes.put(new Integer(ModelPackage.STUDENT__UNITNAME), "dxwtdw");
		attributes.put(new Integer(ModelPackage.STUDENT__UNITPROVINCE), "dwdwss");
		attributes.put(new Integer(ModelPackage.STUDENT__DEPARTMENT), "yjfx");
		
		attributes.put(new Integer(ModelPackage.STUDENT__GENDERCODE), "xbm");
		attributes.put(new Integer(ModelPackage.STUDENT__LEARNCODE), "pyccm");
		attributes.put(new Integer(ModelPackage.STUDENT__MATRICULANDCODE), "lqlbm");
		attributes.put(new Integer(ModelPackage.STUDENT__PROVINCECODE), "syszdm");
		attributes.put(new Integer(ModelPackage.STUDENT__LEARNCODE), "xxxsm");		
		attributes.put(new Integer(ModelPackage.STUDENT__GRADUATEYEAR), "bynd");
		attributes.put(new Integer(ModelPackage.STUDENT__XJBD), "xjbd");
		attributes.put(new Integer(ModelPackage.STUDENT__XJBDM), "xjbdm");
		attributes.put(new Integer(ModelPackage.STUDENT__XJBDSM), "xjbdsm");
		attributes.put(new Integer(ModelPackage.STUDENT__RESULTCODE), "bjyjldm");
		attributes.put(new Integer(ModelPackage.STUDENT__ZP), "zp");
		attributes.put(new Integer(ModelPackage.STUDENT__XSSHSM), "xsshsm");
		attributes.put(new Integer(ModelPackage.STUDENT__FY), "fy");
		attributes.put(new Integer(ModelPackage.STUDENT__XSH), "xsh");
		attributes.put(new Integer(ModelPackage.STUDENT__BH), "bh");
		attributes.put(new Integer(ModelPackage.STUDENT__BZ), "bz");
		attributes.put(new Integer(ModelPackage.STUDENT__SHBS), "shbs");
		attributes.put(new Integer(ModelPackage.STUDENT__ERRORBS), "errorbs");
	}
	
	private static void initialColumnName(){
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__BIRTHDAY), "str.table.birthday.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__COLLEGE), "str.table.college.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__COLLEGECODE), "str.table.collegecode.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__DEPARTMENT), "str.table.department.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__EXAMINENUMBER), "str.table.examinenumber.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__DIPLOMACODE), "str.table.diplomacode.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__GENDER), "str.table.gender.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__GENDERCODE), "str.table.gendercode.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__GRADE), "str.table.grade.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__GRADUATEDATE), "str.table.graduatedate.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__GRADUATEYEAR), "str.table.graduateyear.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__IDNUMBER), "str.table.idnumber.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__LEARNTYPE), "str.table.learntype.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__LEARNCODE), "str.table.learncode.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__LENGTH), "str.table.length.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__LEVEL), "str.table.level.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__LEVELCODE), "str.table.levelcode.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__MATRICULANDTYPE), "str.table.matriculandtype.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__MATRICULANDCODE), "str.table.matriculandcode.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__NAME), "str.table.name.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__NATIONALITY), "str.table.nationality.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__NUMBER), "str.table.number.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__PROVINCE), "str.table.province.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__PROVINCECODE), "str.table.provincecode.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__REGISTERDATE), "str.table.registerdate.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__RESULT), "str.table.result.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__RESULTCODE), "str.table.resultcode.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__SPECIALITYCODE), "str.table.specialitycode.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__SPECIALITYNAME), "str.table.speciality.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__UNITNAME), "str.table.unitname.label");
		columnsName.put(Integer.valueOf(ModelPackage.STUDENT__UNITPROVINCE), "str.table.unitprovince.label");
		
		columnsName.put(new Integer(ModelPackage.STUDENT__XJBD), "str.table.xjbd.label");
		columnsName.put(new Integer(ModelPackage.STUDENT__XJBDM), "str.table.xjbdm.label");
		columnsName.put(new Integer(ModelPackage.STUDENT__XJBDSM), "str.table.xjbdsm.label");
		columnsName.put(new Integer(ModelPackage.STUDENT__ZP), "str.table.zp.label");
		columnsName.put(new Integer(ModelPackage.STUDENT__XSSHSM), "str.table.xsshsm.label");
		columnsName.put(new Integer(ModelPackage.STUDENT__FY), "str.table.fy.label");
		columnsName.put(new Integer(ModelPackage.STUDENT__XSH), "str.table.xsh.label");
		columnsName.put(new Integer(ModelPackage.STUDENT__BH), "str.table.bh.label");
		columnsName.put(new Integer(ModelPackage.STUDENT__BZ), "str.table.bz.label");
		columnsName.put(new Integer(ModelPackage.STUDENT__SHBS), "str.table.shbs.label");
		columnsName.put(new Integer(ModelPackage.STUDENT__ERRORBS), "str.table.errorbs.label");
	}
	
	public static String getColumnName(int key){
		if(columnsName.containsKey(Integer.valueOf(key)))
			return (String)columnsName.get(Integer.valueOf(key));
		else
			return "";
	}
	
	public static String getAttributeName(int key){
		if(attributes.containsKey(new Integer(key)))
			return (String)attributes.get(new Integer(key));
		else
			return null;
	}
}
